

// 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('girlAndBoyPercentage'));
// 绘制图表
myChart.setOption(
    {
        title: {
            text: '男女生比例',
            left: 'center',
            top:'bottom'
        },
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b}: {c} ({d}%)'
        },
      
        series: [
            {
                name: '调查统计',
                type: 'pie',
                radius: ['50%', '70%'],
                avoidLabelOverlap: false,
                label: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    label: {
                        show: true,
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                },
                labelLine: {
                    show: false
                },
                data: [
                    {value: 335, name: '男生'},
                    {value: 310, name: '女生'}
                   
                ]
            }
        ]
    }
);

var myChart2 = echarts.init(document.getElementById('jiaxiangfenbu'));

myChart2.setOption({
    title: {
        text: '家乡分布',
        top:'bottom',
        left: 'center'
    },
    tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b} : {c} ({d}%)'
    },
    series: [
        {
            name: '家乡分布',
            type: 'pie',
            radius: [10, 80],
            center: ['50%', '50%'],
            roseType: 'radius',
            label: {
                show: false
            },
            emphasis: {
                label: {
                    show: false
                }
            },
            data: [
                {value: 10, name: '郑州'},
                {value: 5, name: '信阳'},
                {value: 15, name: '南阳'},
                {value: 25, name: '开封'},
                {value: 20, name: '驻马店'},
                {value: 35, name: '鹤壁'},
                {value: 30, name: '许昌'},
                {value: 40, name: '平顶山'}
            ]
        }
    ]
})

var myChart3 = echarts.init(document.getElementById('agefenbu'));
myChart3.setOption({
    title: {
        text: '年龄分布',
        top:'bottom',
        left: 'center'
    },
    tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b} : {c} ({d}%)'
    },
   
    series: [
        {
            name: '年龄分布',
            type: 'pie',
            radius: '70%',
            center: ['50%', '50%'],
            data: [
                {value: 335, name: '18-22'},
                {value: 310, name: '23-30'},
                {value: 234, name: '30-35'},
                {value: 135, name: '35-40'},
                {value: 1548, name: '40以上'}
            ],
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
})

var myChart4 = echarts.init(document.getElementById('danshen'));

myChart4.setOption({
    title: {
        text: '单身比例',
        top:'bottom',
        left: 'center'
    },
    tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b} : {c} ({d}%)'
    },
   
    series: [
        {
            name: '单身比例',
            type: 'pie',
            radius: '70%',
            center: ['50%', '50%'],
            data: [
                {value: 335, name: '男生单身'},
                {value: 310, name: '女生单身'}
             
            ],
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
})















































